/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package origendatos.dyd.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author erodrig
 */
@Embeddable
public class CaracteristicasPjPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID_PJ", nullable = false)
    private int idPj;
    @Basic(optional = false)
    @Column(name = "ID_CARACTERISTICA", nullable = false, length = 3)
    private String idCaracteristica;

    public CaracteristicasPjPK() {
    }

    public CaracteristicasPjPK(int idPj, String idCaracteristica) {
        this.idPj = idPj;
        this.idCaracteristica = idCaracteristica;
    }

    public int getIdPj() {
        return idPj;
    }

    public void setIdPj(int idPj) {
        this.idPj = idPj;
    }

    public String getIdCaracteristica() {
        return idCaracteristica;
    }

    public void setIdCaracteristica(String idCaracteristica) {
        this.idCaracteristica = idCaracteristica;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idPj;
        hash += (idCaracteristica != null ? idCaracteristica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CaracteristicasPjPK)) {
            return false;
        }
        CaracteristicasPjPK other = (CaracteristicasPjPK) object;
        if (this.idPj != other.idPj) {
            return false;
        }
        if ((this.idCaracteristica == null && other.idCaracteristica != null) || (this.idCaracteristica != null && !this.idCaracteristica.equals(other.idCaracteristica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "origendatos.dyd.model.CaracteristicasPjPK[idPj=" + idPj + ", idCaracteristica=" + idCaracteristica + "]";
    }

}
